<template>
    <h1 v-show="flag">hello world</h1>
    <button @click="btn">点击进行切换</button>
</template>

<script setup lang="js" name="test">
import { ref } from 'vue';
let flag = ref(true);
function btn() {
    flag.value = !flag.value
}
</script>

<style></style>